import request from '@/utils/request'

// 用户注册接口
export const register = (data: {
  username: string
  password: string
  mobile: string
  email?: string
  gender?: number
}) => {
  return request({
    url: '/auth/register/',
    method: 'post',
    data,
  })
}

// 用户登录接口
export const login = (data: { username: string; password: string }) => {
  return request({
    url: '/auth/login/',
    method: 'post',
    data,
  })
}

// 用户退出接口
export const logout = () => {
  return request({
    url: '/auth/logout/',
    method: 'post',
  })
}

// 获取用户信息接口（可选）
export const getUserInfo = () => {
  return request({
    url: '/auth/userinfo/',
    method: 'get',
  })
}
